
local count = 0
gpio.setup(pin.PB10,function()
    count = count + 1
end,gpio.PULLUP)

pwm.open(4, 50, 50,20)


waitFor = "PWM_WAIT"
sys.timerStart(function()
    if count ~= 41 and count ~= 40 then
        print("pwm read counts",count)
        sys.publish(waitFor,false)
    else
        sys.publish(waitFor,true)
    end
end,2000)
